﻿
<div class="list-box-function" <? if ($detailnum == 0) {
 echo "style" . "='display:none'";
} ?> >
 <div class="page-guide">

  <?php
  if ($nowpageid == 1) {
   ?>
   <!--现在页数在第一页的时候-->
   <span>首页</span>
   <span class="positive">前一页</span>
   <!--现在页数非第一页的时候-->
   <?php
  } else {
   ?>
   <!--现在页数非第一页的时候-->
   <a href="detail-list.php?sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&cat_id=<?php echo $_REQUEST['cat_id'] ?>&brand_id=<?php echo $_REQUEST['brand_id'] ?>&select_keywords=<?php echo $_REQUEST['select_keywords'] ?>&sys_part=<? echo $system_part ?>">首页</a>
   <a href="detail-list.php?nowpageid=<?php echo $prepage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&cat_id=<?php echo $_REQUEST['cat_id'] ?>&brand_id=<?php echo $_REQUEST['brand_id'] ?>&select_keywords=<?php echo $_REQUEST['select_keywords'] ?>&sys_part=<? echo $system_part ?>">前一页</a>
   <!--现在页数非第一页的时候-->
   <?php
  }
  ?>


  <!--开始列印出所有页码-->

  <?php
  $ii = 1;
  $iii = 1;

  while ($ii <= $page_count) {
   //首先判断是不是当前页

   if ($ii == $nowpageid) {
    echo "<span>" . $ii . "</span>";
   } else if ((($ii + 8) < $nowpageid) || (($ii - 8) > $nowpageid)) {
   } else {
    echo "<a href='";
    echo "detail-list.php?nowpageid=";
    echo $iii;
    echo "&sortby=";
    echo $sort_by;
    echo "&nid=";
    echo $trans_nid;
	
    echo "&cat_id=";
    echo $_REQUEST['cat_id'];
       echo "&brand_id=";
       echo $_REQUEST['brand_id'];
       echo "&select_keywords=";
       echo $_REQUEST['select_keywords'];
	
    echo "&sys_part=";
    echo $system_part;
    echo "'>";
    echo $iii;
    echo "</a>";
   }

   $ii++;
   $iii++;
  }
  ?>

  <!--列印出所有页码 结束-->


  <?php
  if ($nowpageid == $page_count) {
   ?>
   <!--现在页数在第一页的时候-->
   <span  class="positive">后一页</span>
   <span>末页</span>
   <!--现在页数非第一页的时候-->
   <?php
  } else {
   ?>
   <!--现在页数非第一页的时候-->
   <a href="detail-list.php?nowpageid=<?php echo $nextpage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&cat_id=<?php echo $_REQUEST['cat_id'] ?>&brand_id=<?php echo $_REQUEST['brand_id'] ?>&select_keywords=<?php echo $_REQUEST['select_keywords'] ?>&sys_part=<? echo $system_part ?>">后一页</a>
   <a href="detail-list.php?nowpageid=<?php echo $lastpage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&cat_id=<?php echo $_REQUEST['cat_id'] ?>&brand_id=<?php echo $_REQUEST['brand_id'] ?>&select_keywords=<?php echo $_REQUEST['select_keywords'] ?>&sys_part=<? echo $system_part ?>">末页</a>
   <!--现在页数非第一页的时候-->
   <?php
  }
  ?>


 </div>
 <!--翻页代码结束-->